import React, {  } from 'react'
import { Badge, TabBar } from 'antd-mobile'
import {
  AppOutline,
  MessageOutline,
  MessageFill,
  UnorderedListOutline,
  UserOutline,
} from 'antd-mobile-icons'
import styles from './css/Mytabbar.module.css'
import { useNavigate } from 'react-router-dom'

function Mytabbar() {
    let nav=useNavigate()
    const tabs = [
        {
          key: '/index',
          title: '首页',
          icon: <AppOutline />,
        },
        {
          key: '/two',
          title: '待办',
          icon: <UnorderedListOutline />,
        },
        {
          key: '/three',
          title: '消息',
          icon: (active) =>
            active ? <MessageFill /> : <MessageOutline />,
        },
       
      ]
  return (
    <div className={styles.box}>
         <TabBar onChange={(key)=>{nav(key)}}>
          {tabs.map(item => (
            <TabBar.Item key={item.key} icon={item.icon} title={item.title} />
          ))}
        </TabBar>
    </div>
  )
}

export default Mytabbar
